<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/styles/flightlist.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-form/jquery.form.js"></script>
    <link href="/js/datepicker/datepicker.css" rel="stylesheet" type="text/css">
    <script src="/js/datepicker/datepicker.js"></script>
    <script>
        $(function () {
            $(".f-item").click(function () {
                if ($(this).hasClass("f-item-on")) {
                    $(this).removeClass("f-item-on");
                } else {
                    $(this).addClass("f-item-on");
                }
            });
            $('[data-toggle="datepicker"]').datepicker({
                format: 'yyyy-mm-dd',
                startDate: new Date(),
                months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                daysMin: ['日', '一', '二', '三', '四', '五', '六'],
                autoHide: true
            });

            $("#search").click(function () {
                var depart = $("#departCity").val();
                var dest = $("#destCity").val();
                var time = $("#one_way_input").val();
                window.location.href = "http://localhost:8888/flight/list?source=" + depart + "&dest=" + dest + "&time=" + time;
            });
            $(".f-btn").click(function () {
                var depart = $("#departCity").val();
                var dest = $("#destCity").val();
                var time = $("#one_way_input").val();
                window.location.href = "http://localhost:8888/flight/book?depart="+depart+"&dest="+dest+"&time="+time;
            });
        })
    </script>
</head>
<body>
<#assign currentNav="flight">
<#include "../common/navbar.ftl">

<div class="f-search">
    <div class="f-search-wrap">
        <div class="s-type">
            <a class="on" id="one_way_btn" ng-click="setOneWay()">单程</a>
            <a id="round_way_btn" style="display: none" ng-click="setRonudWay()">往返</a>
        </div>
        <div class="s-city">
            <div class="inp-wrap city-wrap">
                <input class="inp-txt ng-pristine ng-valid" id="departCity" type="text" ng-model="departCityInput"
                       placeholder="出发城市" value="${(qo.source)!}">
            </div>
            <a class="btn-switch" ng-click="switchCity()"></a>
            <div class="inp-wrap city-wrap">
                <input class="inp-txt ng-pristine ng-valid" id="destCity" type="text" ng-model="destCityInput"
                       placeholder="到达城市" value="${(qo.dest)!}">
            </div>
        </div>
        <div class="s-date">
            <div class="inp-wrap date-wrap"><input type="text" id="one_way_input" class="hasDatepicker"
                                                   value="${(qo.time?string("yyyy-MM-dd"))!}"
                                                   data-toggle="datepicker"><input
                        type="text" id="round_way_input" style="display: none" class="hasDatepicker"
                ><i
                        class="icon-calendar"></i></div>
        </div>
        <div id="search" class="s-btn ng-scope" ng-click="search('')" ng-if="status != 2"><a><i class="icon-search"></i>搜索</a></div>
    </div>
</div>

<div class="container">
    <div class="main" style="position: relative">
        <div class="f-selected">
            <span class="label">筛选 :</span>
            <div id="filter_all" style="">
            </div>
            <a class="sel-del" ng-click="resetFilter()">全部撤销</a>
        </div>
        <div class="f-sortbar">
            <div class="loading-bar"><span id="progress_bar" style="width: 100%; display: none;"></span></div>
            <ul class="clearfix">
                <li class="item1">航空信息</li>
                <li class="item2" ng-click="sortByDepTime()"><span class="f-sort" id="sort_dep_time">起飞时间<i
                                class="up"></i><i class="down"></i></span></li>
                <li class="item3" ng-click="sortByArrTime()"><span class="f-sort" id="sort_arr_time">到达时间<i
                                class="up"></i><i class="down"></i></span></li>
                <li class="item3" ng-click="sortByPrice()"><span class="f-sort" id="sort_price">价格<i class="up"></i><i
                                class="down"></i></span></li>
            </ul>
        </div>
        <div class="f-msg" id="empty_view" style="display: none">
            <i class="msg-icon-cry"></i>
            <p>暂无符合条件的机票信息，请重新搜索</p>
        </div>
        <div id="flight_list" style="">
            <#list list as t>
                <div class="f-list ng-scope" ng-repeat="one in result.flights|orderBy:sort.key:sort.type"
                     ng-if="loaded">
                    <#--这个class属性决定是否出现选定按钮:f-item-on-->
                    <div class="f-item " ng-attr-id="{{ 'airline-item-' + one.flight_no }}"
                         ng-click="showSubInfo(one)"
                         id="airline-item-HU7602">
                        <div class="f-item-info ng-scope" ng-if="one.flight_no">
                            <div class="f-line">
                            <span class="airline-logo"><i ng-attr-id="{{ 'logo-item-' + one.flight_no }}"
                                                          id="logo-item-HU7602" class="airline-logo-HU"></i></span>
                                <p class="f-name ng-binding">
                                    ${(t.airline_name)!} <span class="ng-binding">${(t.flight_no)!}</span>
                                </p>
                                <p class="sub ng-binding">${(t.plane_type)!}</p>
                            </div>
                            <div class="f-time">
                                <div class="time ng-binding"
                                     ng-bind="one.dep_time">${(t.dep_time)!}</div>
                                <p class="sub ng-binding">${(t.org_airport_name)!}${(t.org_airport_quay)!}</p>
                            </div>
                            <div class="through">
                                <div class="arrow"></div>
                                <p class="duration ng-binding" ng-bind="one.takingTime">${(t.last)!}</p>
                                <div class="f-pop f-pop-stay">
                                    <i class="pop-arrow"></i>
                                    <strong>经停</strong>
                                    <p>经停城市：<span ng-bind="one.stop_infos.city_name" class="ng-binding"></span></p>
                                </div>
                            </div>
                            <div class="f-time">
                                <div class="time ng-binding"
                                     ng-bind="one.arr_time">${(t.arr_time)!}</div>
                                <p class="sub ng-binding">${(t.dst_airport_name)!}${(t.dst_airport_quay)!}</p>
                            </div>
                            <div class="f-price">
                                <div class="price"><sup>￥</sup><strong ng-bind="getFlightPrice(one)"
                                                                       class="ng-binding">${(t.base_price)!}</strong> 起
                                </div>
                            </div>
                            <div class="f-action"><a class="f-less" ng-click="hideSubInfo(one)">收起<i></i></a></div>
                        </div>
                        <div class="f-item-class ng-scope" ng-if="show_sub_info" ng-click="showSubInfo(one)">
                            <div class="class-caption">
                                <span>准点率<d ng-if="one.correctness <= 0" class="ng-scope">--</d></span>
                                <span class="ng-binding">机建${(t.airport_tax_audlet)!}</span><span class="ng-binding">燃油￥${(t.fuel_tax_audlet)!}</span>
                                <span ng-if="!one.meal" class="ng-scope">${(t.meal?string("有餐食","无餐食"))!}</span>
                            </div>

                            <div class="class-group ng-scope" ng-if="one.price_seat_infos">
                                <div class="group-label">详细信息</div>
                                <div class="class-item ng-scope"
                                     ng-repeat="item in one.price_seat_infos | orderBy:'settle_price_insurance' ">
                                    <div class="class-title">
                                        <div class="f-policy">
                                            <p>退改签及行李额规则</p>
                                            <div class="f-pop f-pop-policy">
                                                <i class="pop-arrow"></i>
                                                <ul>
                                                    <li class="ng-binding"><span>签转规定</span>：不可签转</li>
                                                    <li class="ng-binding"><span>改期规定</span>：不可改期</li>
                                                    <li class="ng-binding"><span>退票规定</span>：只退机建和燃油</li>
                                                    <li class="tips">以上手续费按每笔订单中每个出行人单独计算。</li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="f-policy">
                                            <p>行李限额</p>
                                            <div class="f-pop f-pop-policy">
                                                <i class="pop-arrow"></i>
                                                <ul>
                                                    <li class="ng-binding"><span>限额规定</span>：无免费托运行李额，含一件免费手提行李7KG，且体积不超过20X30X40CM。
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="f-policy ng-scope"
                                             ng-if="item.supplierName || item.supplierIATANumber">
                                            <p>供应商信息</p>
                                            <div class="f-pop f-pop-policy">
                                                <i class="pop-arrow"></i>
                                                <ul>
                                                    <li ng-if="item.supplierName" class="ng-binding ng-scope">
                                                        <span>供应商：</span>湖南就走软件科技有限公司
                                                    </li>
                                                    <li ng-if="item.supplierIATANumber" class="ng-binding ng-scope">
                                                        <span>IATA号：</span>08331912
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                        <span class="small-tag ng-binding ng-scope" ng-if="item.tag_name"
                                              ng-bind="item.tag_name">行程单</span>
                                    </div>
                                    <div class="class-price">
                                        <strong class="ng-binding">￥${(t.base_price)!}</strong>
                                    </div>
                                    <div class="class-buy">
                                        <a class="f-btn" ng-click="booking(one,item,'')">选定</a>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>

            </#list>
        </div>
        <div align="right" class="m-pagination" id="flight_page" style="">
            <span class="count ng-binding">共${(page.total)!}条</span>
        </div>
    </div>
    <div class="aside">
        <div class="service mb10">
            <ul class="clearfix">
                <li class="s1"><i></i><br>航协认证</li>
                <li class="s2"><i></i><br>出行保证</li>
                <li class="s3"><i></i><br>7X24</li>
            </ul>
            <div class="tel">免费客服电话：4006345678</div>
        </div>
        <div class="banner"><a ng-href="" target="_blank">
                <img ng-src="https://b3-q.mafengwo.net/s14/M00/1B/6B/wKgE2l0IoqiADHpKAAItDErw7lk257.png"
                     src="https://b3-q.mafengwo.net/s14/M00/1B/6B/wKgE2l0IoqiADHpKAAItDErw7lk257.png"></a></div>
    </div>
</div>

<#include "../common/footer.ftl">
</body>
</html>